<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<meta name="renderer" content="webkit|ie-comp|ie-stand">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta charset='utf-8'>
        <meta name="author" content="order by dede58.com"/>
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<title>付款</title>
		<meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<meta http-equiv="Cache-Control" content="no-siteapp">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="mobile-web-app-capable" content="yes">
		<meta name="format-detection" content="telephone=no">
		<meta name="keywords" content="">
		<meta name="description" content="">
		<link rel="stylesheet" type="text/css" href="css/base.css" />
		<link rel="stylesheet" type="text/css" href="css/common.css" />
		<script src="js/jquery-1.8.3.min.js" type="text/javascript"></script>
		<script type="text/javascript" src="js/jquery.SuperSlide.2.1.js"></script>
		
		<script type="text/javascript" src="js/jquery-3.6.0.js"></script>
		
		<script src="js/head.js"></script>
	</head>
	
	
	
	<script>
		$(function(){
			let nickname = "${sessionScope.customer.nickname}";
			let content = "";
			if(nickname!=""){
				content = "<span class=\"fl\">欢迎</span>"+
						"<a href=\"grxx.jsp\" class=\"fl\">"+nickname+"</a>"+
						"<span class=\"fl\">进入商城</span>"+
						"<a href=\"../LoginServlet?op=customerLogout\" class=\"fl\">退出登陆</a>";
			}else{
				content = "<span class=\"fl\">您好，请</span>"+
						"<a href=\"sign.jsp\" class=\"fl\">登录</a>";
			}
			$("#customerInfo").html(content);
			
			console.log("${param.out_trade_no}");
			/* 更改订单的状态为已支付 */
			$.ajax({
				async:true,
				type:"GET",
				url:"../OrderServlet",
				data:{
					op:"updateOrderInfoStatus",
					status:"1",
					orderNo:"${param.out_trade_no}"
				},
				contentType:"application/x-www-form-urlencoded",
				dataType:"json",
				success:function(result,status,xhr){
					if(result.status==1){
						// 更改已支付成功
					}
					
				},
				
			});	
			
			/* 获取订单信息 */
			$.ajax({
				async:true,
				type:"GET",
				url:"../OrderServlet",
				data:{
					op:"findOrderInfoByOrderNo",
					orderNo:"${param.out_trade_no}"
				},
				contentType:"application/x-www-form-urlencoded",
				dataType:"json",
				success:function(result,status,xhr){
					if(result.status==1){
						$("#pay").text(result.data.total);
						
					}
					
				},
				
			});
			
			
		});
			
	</script>
	
	
	<script type="text/javascript">
		$(function(){
			/* 创建一个查询方法通过游戏编号查询游戏信息添加入购物车*/
			function s(){
				$.ajax({
					async:true,
					type:"GET",
					url:"../OrderServlet",
					data:{
						op:"find",
						orderNo:"0",
						customerId:${sessionScope.customer.customerId}
					},
					contentType:"application/x-www-form-urlencoded",
					dataType:"json",
					success:function(result,status,xhr){
						let count = 0;
						$.each(result.data,function(index,games){
							count = index + 1;
						});
						$("#shopCount").text("购物车（"+count+"）");
						
					},
					
				});	
			}
			/* 调用方法通过游戏编号查询游戏信息添加入购物车*/
			s();
		});
		</script>
	
	
	<body>
		
		<!--Main-wrap-->
		<div class="main-wrap graybg" id="cen" style="margin-top: 86px;">
			<div class="wrapper pt40 pb40">
				<div class="order-detail-box white-box clearfix">
					<p class="fl icon"> <i class="iconfont">&#xe613;</i></p>
					<div class="fr order-info">
						<div class="line-bot pt20 pb20 clearfix">
							<p class="fl l-suc-info">
								<span class="full-db fs26 darkgray">付款成功，实付金额 <em class="orange" id="pay">999.00</em> 元</span>
								<span class="full-db fs14 lh30">游戏已经发送至您的游戏仓库，请前往个人游戏仓库查看</span>
							</p>
							<p class="fr r-suc-info tr">
								<span class="full-db fs14 lh30">订单号： ${param.out_trade_no}</span>
								<span class="full-db fs14 lh30"><a href="javascript:" class="detail-show" id="xq">订单详情<i class="icon"></i></a></span>
							</p>
						</div>
						<div class="order-show pt10">
							<span class="full-db fs14 lh30 darkgray"></span>
							<span class="full-db fs14 lh30 darkgray" id="info">商品信息     墙角数枝梅，凌寒独自开  X 1</span>
						</div>
					</div>
				</div>
				<div class="pay-order-style white-box mt20">
					
					<div class="pay-cont">
						<form action="">
							<div class="next go-pay pt30 clearfix">
								<input type="button" class="radius3 orange-but fs20" value="返回游戏商城主页" onclick="sczy();">
								<input type="button" class="radius3 orange-but fs20" value="前往个人游戏仓库" onclick="grck();">
							</div>
						</form>
					</div>

				</div>

			</div>
		</div>
		<!--/end-->
		<script type="text/javascript">
		
		function grck(){
			location.href="../CustomerServlet?op=pjsd";
		}
		function sczy(){
			location.href="index.jsp";
		}
		// 支付方式仅能选择其中一项
		$(document).ready(function(){
			$("#xq").click(function(){
			  $(this).siblings().removeClass("show-on");
			  if($(this).hasClass("show-on")){
			   $(this).removeClass("show-on");
			   $(".order-show").hide();
			  }else{
			   $(this).addClass("show-on");
			   $(".order-show").show();
				  }

			})
			  $(".check-inline").click(function(){
				  $(this).addClass("check_on");	
				  if($(this).parents(".xz").siblings().find("a").hasClass("check_on")) {
						$(this).parents(".xz").siblings().find("a").removeClass("check_on");
					}
				  if($(this).siblings().hasClass("check_on")){
						$(this).siblings().removeClass("check_on");
					}
			  });
			});
		</script>
		<!--footer star-->
		<div class="footer clearfix">
			<div class="content clearfix">
				<div class="top clearfix">
					<div class="list clearfix fl box-s">
						<div class="part icon1 box-s">
							<h3>专业</h3>
							<p>拥有资深游戏顾问和先进交易平台，安全交易，快捷支付。</p>
						</div>
					</div>
					<div class="list clearfix fl box-s">
						<div class="part icon2 box-s">
							<h3>保真</h3>
							<p>阵容强大的游戏评鉴团，确保平台上的游戏货真价实。</p>
						</div>
					</div>
					<div class="list clearfix fl box-s">
						<div class="part icon3 box-s">
							<h3>保值</h3>
							<p>为您精选具备收藏价值的游戏作品，助您的资产保值、增值。</p>
						</div>
					</div>
				</div>
				<div class="bottom clearfix">
					<div class="left clearfix fl">
						<div class="list clearfix">
							<div class="shang clearfix">
								<p>新手指南</p>
								<span></span>
							</div>							
							<div class="xia clearfix">
								<ul>
									<li><a href="scgmlc.html">购买流程</a></li>
									<li><a href="cjwt.html">常见问题</a></li>
								</ul>
							</div>
						</div>
						<div class="list clearfix">
							<div class="shang clearfix">
								<p>账户管理</p>
								<span></span>
							</div>							
							<div class="xia clearfix">
								<ul>
									<li><a href="zhcz.html">账户充值</a></li>
									<li><a href="zhtx.html">账户提现</a></li>
									<li><a href="zffs.html">支付方式</a></li>
								</ul>
							</div>
						</div>						
						<div class="list clearfix">
							<div class="shang clearfix">
								<p>服务合作</p>
								<span></span>
							</div>							
							<div class="xia clearfix">
								<ul>
									<li><a href="friend-link.html">友情链接</a></li>
									<li><a href="ysjrz.html">玩家入驻</a></li>
								</ul>
							</div>
						</div>
						<div class="list clearfix">
							<div class="shang clearfix">
								<p>关于我们</p>
								<span></span>
							</div>							
							<div class="xia clearfix">
								<ul>
									<li><a href="gsjj.html">公司简介</a></li>
									<li><a href="contact.html">联系我们</a></li>
									<li><a href="jrwm.html">加入我们</a></li>
								</ul>
							</div>
						</div>
						<div class="list clearfix">
							<div class="shang clearfix">
								<p>售后服务</p>
								<span></span>
							</div>							
							<div class="xia clearfix">
								<ul>
									<li><a href="wlsm.html">交易说明</a></li>
									<li><a href="mzsm.html">免责声明</a></li>
								</ul>
							</div>
						</div>
					</div>
					<div class="middle clearfix fl">
						<ul>
							<li><img src="upload/ewm.jpg"/></li>
							<li><img src="upload/ewm.jpg"/></li>
						</ul>
					</div>
					<div class="right clearfix fr">
						<p class="bt">免费咨询热线：</p>
						<p class="tel">400-000-0000</p>
						<p class="fu-bt">(周一到周五8:00-22:00)</p>
					</div>
				</div>
			</div>
			<div class="banquan clearfix ta-center">
				Copyright © 2021 厦门游戏商城(xiamenyouxishangcheng). All Rights Reserved. 
			</div>
		</div>
		<!--footer end-->
	</body>
	<script src="js/other.js" type="text/javascript" ></script>
</html>